
import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import Category from './Category/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import type { App } from 'vue'
const allGlobalComponent: any = { SvgIcon, Pagination, Category }
//对外暴露插件对象
export default {
    //使用install方法
    install(app: App<Element>) {
        //注册项目中的全部组件
        Object.keys(allGlobalComponent).forEach(key => {
            console.log(key);
            //注册全局组件
            app.component(key, allGlobalComponent[key]);
        });
        //注册element-plus的全部组件为全局组件
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }
    }
}